package Map;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

/*从键盘输入一个字符串，判断每个字符出现的次数*/

public class Test {
    public static void main(String[] args) {
        Map<Character,Integer> map = new HashMap<>();
        Scanner s = new Scanner(System.in);
        String next = s.next();
        //把字符串转化为字符数组
        char[] chars = next.toCharArray();
        for(char i : chars){
            //如果i已存在，把对应的value +1
            if(map.get(i) != null){
                //通过get方法获取对应的value值，然后加1，重新存入map
                Integer value = map.get(i);
                value ++;
                map.put(i,value);
            }else {
                map.put(i,1);
            }
        }
        Set<Map.Entry<Character, Integer>> entries = map.entrySet();
        for (Map.Entry<Character,Integer> i : entries){
            Character key = i.getKey();
            Integer value = i.getValue();
            System.out.println(key + " : " + value);

        }
    }
}
